package app.kisslinux.cn.utilsforlin.ui.dialog;

import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.support.v7.app.AlertDialog;

/**
 * Created by lsk on 2018-12-20 21:26.
 *
 * @author 庄壮壮
 */
public class DialogFactory {

    private static DialogFactory instance = new DialogFactory();

    public static DialogFactory instance() {
        return instance;
    }

    public Dialog createSimpleDialog(Context context, String title, String message) {
        return new AlertDialog.Builder(context)
                .setTitle(title)
                .setMessage(message)
                .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        dialog.dismiss();
                    }
                }).create();
    }
}
